package com.css.crm.dao.impl;

import java.util.List;

import org.apache.ibatis.session.SqlSession;

import com.css.crm.dao.RegisterTelephoneDao;
import com.css.crm.vo.RegisterTelephoneVo;

/**
 * Implementation for RegisterTelephoneDao
 * 
 * @author ais
 */
public class RegisterTelephoneDaoImpl extends BaseDaoImpl implements RegisterTelephoneDao {

	public RegisterTelephoneDaoImpl() {
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.css.crm.dao.RegisterTelephoneDao#getRegisterTelephoneById(com.css
	 * .crm.vo.RegisterTelephoneVo)
	 */
	@Override
	public RegisterTelephoneVo getRegisterTelephoneById(RegisterTelephoneVo vo) {

		SqlSession session = getMyBatisSession();
		return session.selectOne("registerTelephone.getRegisterTelephoneById", vo);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.css.crm.dao.RegisterTelephoneDao#deleteRegisterTelephoneById(com.
	 * css.crm.vo.RegisterTelephoneVo)
	 */
	@Override
	public int deleteRegisterTelephoneById(RegisterTelephoneVo vo) {

		SqlSession session = getMyBatisSession();
		return session.delete("registerTelephone.deleteRegisterTelephoneById", vo);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.css.crm.dao.RegisterTelephoneDao#insertRegisterTelephone(com.css.
	 * crm.vo.RegisterTelephoneVo)
	 */
	@Override
	public int insertRegisterTelephone(RegisterTelephoneVo vo) {

		SqlSession session = getMyBatisSession();
		return session.insert("registerTelephone.insertRegisterTelephone", vo);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.css.crm.dao.RegisterTelephoneDao#updateRegisterTelephone(com.css.
	 * crm.vo.RegisterTelephoneVo)
	 */
	@Override
	public int updateRegisterTelephone(RegisterTelephoneVo vo) {

		SqlSession session = getMyBatisSession();
		return session.update("registerTelephone.updateRegisterTelephone", vo);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.css.crm.dao.RegisterTelephoneDao#queryRegisterTelephone(com.css.crm
	 * .vo.RegisterTelephoneVo)
	 */
	@Override
	public List<RegisterTelephoneVo> queryRegisterTelephone(RegisterTelephoneVo vo) {

		SqlSession session = getMyBatisSession();
		return session.selectList("registerTelephone.queryRegisterTelephone", vo);
	}

}
